
cc.Class({
    extends: cc.Component,

    properties: {
        player: cc.Node,
        jetPack: cc.Node
    },

    // onLoad () {},

    start() {
        this.playerRig = this.player.getComponent(cc.RigidBody);
        this.playerPhysicsBox = this.player.getComponent(cc.PhysicsBoxCollider);
    },

    onBeginContact: function (contact, selfCollider, otherCollider) {
        if (this.player.model === "Land" && otherCollider.tag === 88 && selfCollider.tag === cc.vv.TAG.JETTUBE) {
            this.player.model = "JetTube";
            this.player.prop = "handLeave";
            this.jetPack.active = true;

        } else if (this.player.model === "JetTube" && otherCollider.tag === 88&& selfCollider.tag === cc.vv.TAG.JETTUBEEND) {
            //陆地
            this.player.model = "Land";
            this.player.prop = "Stand";
            this.jetPack.active = false;
            // this.playerRig._b2Body.m_linearVelocity.y = 8;
            // this.playerRig._b2Body.m_gravityScale = 3;
            // this.playerRig.fixedRotation = true;
        }
    },
});
